import { NToast } from "@/components/Uikit";
import { PropsWithChildren } from "react";
import MantineProvider from "./mantine/MantineProvider";
import ThemeProvider, { ThemeContext } from "./themes/ThemeProvider";

export default (props: PropsWithChildren) => {
  return (
    <ThemeProvider>
      <ThemeContext.Consumer>
        {(ctx) => (
          <>
            <MantineProvider colors={ctx?.themeValue.colors}>
              <NToast />
              {props.children}
            </MantineProvider>
          </>
        )}
      </ThemeContext.Consumer>
    </ThemeProvider>
  );
};
